//
//  MaterialCollectionViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "MaterialCollectionViewCell.h"

@implementation MaterialCollectionViewCell
- (void)dealloc
{
    [_img release];
    [_name release];
    [super dealloc];
}
//初始化
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    
    self.img = [[ UIImageView alloc] init];
    [self.contentView addSubview:_img];
   // self.img.backgroundColor = [ UIColor redColor];
    [_img release];
    self.name = [[ UILabel alloc] init];
   // self.name.backgroundColor =[ UIColor yellowColor];
    [self.contentView addSubview:_name];
    [_name release];
    }
    return self;
        
}
//布局
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _img.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width - 20 * WIDTH, layoutAttributes.frame.size.height);
    _name.frame = CGRectMake(0,layoutAttributes.frame.size.height+10*HEIGHT , layoutAttributes.frame.size.width - 20 * WIDTH, layoutAttributes.frame.size.height - 40*HEIGHT);
}
@end
